VERSION 5.00
Begin VB.Form frmMovie 
   AutoRedraw      =   -1  'True
   BackColor       =   &H0099BABD&
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "TorrenTV Movie Search"
   ClientHeight    =   1770
   ClientLeft      =   45
   ClientTop       =   315
   ClientWidth     =   5955
   ControlBox      =   0   'False
   BeginProperty Font 
      Name            =   "Verdana"
      Size            =   9.75
      Charset         =   0
      Weight          =   700
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   ForeColor       =   &H00828B8F&
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1770
   ScaleWidth      =   5955
   ShowInTaskbar   =   0   'False
   Visible         =   0   'False
   Begin VB.Timer tmrSearch 
      Enabled         =   0   'False
      Interval        =   50
      Left            =   240
      Top             =   1800
   End
   Begin VB.OptionButton optCam 
      BackColor       =   &H0099BABD&
      Caption         =   "CAM"
      Height          =   375
      Left            =   4920
      Style           =   1  'Graphical
      TabIndex        =   4
      ToolTipText     =   "Recommended for movies that are still in theaters."
      Top             =   600
      Width           =   855
   End
   Begin VB.OptionButton optDVDScr 
      BackColor       =   &H0099BABD&
      Caption         =   "DVDScr"
      Height          =   375
      Left            =   3720
      Style           =   1  'Graphical
      TabIndex        =   3
      ToolTipText     =   "Recommended for movies that are not on DVD yet, but are no longer in theaters."
      Top             =   600
      Width           =   1095
   End
   Begin VB.OptionButton optXViD 
      BackColor       =   &H0099BABD&
      Caption         =   "XViD"
      Height          =   375
      Left            =   2640
      Style           =   1  'Graphical
      TabIndex        =   2
      ToolTipText     =   "Recommended for a high-quality but small-size (700MB) movie file."
      Top             =   600
      Width           =   975
   End
   Begin VB.OptionButton optDVDRip 
      BackColor       =   &H0099BABD&
      Caption         =   "DVDRip"
      Height          =   375
      Left            =   1440
      Style           =   1  'Graphical
      TabIndex        =   1
      ToolTipText     =   "Recommended for movies that have already been released on DVD"
      Top             =   600
      Value           =   -1  'True
      Width           =   1095
   End
   Begin VB.TextBox txtMovie 
      Appearance      =   0  'Flat
      BackColor       =   &H0099BABD&
      ForeColor       =   &H00000000&
      Height          =   360
      Left            =   1440
      TabIndex        =   0
      Text            =   "The Beach"
      ToolTipText     =   "Name of the movie you want to download.l"
      Top             =   120
      Width           =   4335
   End
   Begin VB.Label lblSearching 
      BackColor       =   &H0099BABD&
      Caption         =   "S E A R C H I N G . . ."
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   120
      TabIndex        =   11
      Top             =   1200
      Visible         =   0   'False
      Width           =   5775
   End
   Begin VB.Label lblCancel 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "Cancel"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   320
      Left            =   4200
      TabIndex        =   6
      ToolTipText     =   "Go back to the main screen."
      Top             =   1200
      Width           =   1500
   End
   Begin VB.Label lblSearch 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "Search && Download"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   320
      Left            =   600
      TabIndex        =   5
      ToolTipText     =   "Begin search for movie's torrent; if found, automatically download the torrent."
      Top             =   1200
      Width           =   3500
   End
   Begin VB.Label lblOptions 
      BackStyle       =   0  'Transparent
      Caption         =   "Options:"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   240
      TabIndex        =   8
      Top             =   660
      Width           =   1095
   End
   Begin VB.Label lblTitle 
      BackStyle       =   0  'Transparent
      Caption         =   "Movie Title:"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   135
      TabIndex        =   7
      Top             =   165
      Width           =   1335
   End
   Begin VB.Label lblSearch2 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "Search && Download"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00808080&
      Height          =   320
      Left            =   660
      TabIndex        =   9
      Top             =   1245
      Width           =   3500
   End
   Begin VB.Label lblCancel2 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "Cancel"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00808080&
      Height          =   320
      Left            =   4260
      TabIndex        =   10
      Top             =   1245
      Width           =   1500
   End
End
Attribute VB_Name = "frmMovie"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Form_Load()
    txtMovie.Text = frmMain.regGet("movie")
    If txtMovie.Text = "" Then txtMovie.Text = "The Beach"
    
    Select Case frmMain.regGet("movie_opt")
    Case "dvdscr"
        optDVDScr.Value = True
    Case "xvid"
        optXViD.Value = True
    Case "cam"
        optCam.Value = True
    Case Else
        optDVDRip.Value = True
        frmMain.regSet "movie_opt", "dvdrip"
    End Select
End Sub

Private Sub Form_Resize()
    If Me.Visible = True Then
        txtMovie.SelStart = 0
        txtMovie.SelLength = Len(txtMovie.Text)
        txtMovie.SetFocus
    End If
End Sub

Private Sub lblCancel_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
    frmMain.ControlMousedown Button, lblCancel, lblCancel2
End Sub
Private Sub lblCancel_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)
    frmMain.ControlMousemove Button, lblCancel, lblCancel2, x, Y
End Sub
Private Sub lblCancel_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single)
    If frmMain.ControlMouseup(Button, lblCancel, lblCancel2) = True Then
        Me.Hide
        Unload Me
    End If
End Sub

Private Sub lblSearch_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
    frmMain.ControlMousedown Button, lblSearch, lblSearch2
End Sub
Private Sub lblSearch_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)
    frmMain.ControlMousemove Button, lblSearch, lblSearch2, x, Y
End Sub
Private Sub lblSearch_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single)
    If frmMain.ControlMouseup(Button, lblSearch, lblSearch2) = True Then
        search_click
    End If
End Sub
Private Sub search_click()
    frmMain.regSet "movie", txtMovie.Text
    lblSearching.Visible = True
    tmrSearch.Enabled = True
    If frmMain.MovieSearch(txtMovie.Text) = True Then
        Me.Hide
        Unload Me
        Exit Sub
    End If
    lblSearching.Visible = False
    tmrSearch.Enabled = False
End Sub

Private Sub optCam_Click()
    frmMain.regSet "movie_opt", "cam"
End Sub

Private Sub optDVDRip_Click()
    frmMain.regSet "movie_opt", "dvdrip"
End Sub

Private Sub optDVDScr_Click()
    frmMain.regSet "movie_opt", "dvdscr"
End Sub

Private Sub optXViD_Click()
    frmMain.regSet "movie_opt", "xvid"
End Sub

Private Sub tmrSearch_Timer()
    Dim i%, c%
    
    If tmrSearch.Tag = "" Then
        'add spaces to the beginning of the label
        For i% = 1 To Len(lblSearching.Caption)
            If Mid(lblSearching.Caption, i%, 1) = " " Then
                c% = c% + 1
            Else
                Exit For
            End If
        Next i%
        If c% < 13 Then
            lblSearching.Caption = " " + lblSearching.Caption
        Else
            tmrSearch.Tag = "X"
        End If
    Else
        'subtract spaces from the beginning of the label
        For i% = 1 To Len(lblSearching.Caption)
            If Mid(lblSearching.Caption, i%, 1) = " " Then
                c% = c% + 1
            Else
                Exit For
            End If
        Next i%
        If c% > 0 Then
            lblSearching.Caption = Right(lblSearching.Caption, Len(lblSearching.Caption) - 1)
        Else
            tmrSearch.Tag = ""
        End If
    End If
End Sub

Private Sub txtMovie_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        KeyCode = 0
        search_click
        Exit Sub
    End If
End Sub
